package com.paziy.jan.calc.literals.numbers;

import com.paziy.jan.calc.literals.Literal;

import java.math.BigDecimal;

public class Num extends Number implements Literal {

    private BigDecimal number;

    public Num(BigDecimal number) {
        this.number = number;
    }

    public Num(double number) {
        this.number = new BigDecimal(number);
    }

    public BigDecimal bigDecimalValue() {
        return number;
    }

    @Override
    public String toString() {
        return number.toString();
    }

    @Override
    public int intValue() {
        return number.intValue();
    }

    @Override
    public long longValue() {
        return number.longValue();
    }

    @Override
    public float floatValue() {
        return number.floatValue();
    }

    @Override
    public double doubleValue() {
        return number.doubleValue();
    }
}
